#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "LED.h"
#include "IIC.h"
#include "exti.h"
#include "r820t2.h"

u8 t=0;
uint8_t i =0;
uint8_t buf_Write[32]={0xFF};
uint8_t buf_Read[32]={0xFF};
int main()
{
    delay_init();
    LED_Init();
	R820T_IIC_Init();
    uart_init(115200);
//	R820T_Conf_Init();
	delay_ms(100);
	R820T_Conf_Init();
	MCO_GPIO_Config();
    while(1)
    {	
//		buf_Write[0] = 0x55;
//		buf_Write[1] = 0x44;
//		R820T_Write_Byte(0x34,0x07,1,buf_Write); //写入00不行,必须得输入05
		R820T_Read_Byte(0x34,0x00,0x20,buf_Read) ;
		for(i=0;i< 0x20;i++)
		{
			printf("R%x:0x%x\r\n",i,buf_Read[i]);
		}
		delay_ms(1000);
		printf("\r\n");
		LED2ON;
        delay_ms(100);
        LED2OFF;
        R820T_Conf_Init();
		delay_ms(1000);
		delay_ms(1000);
    }
}


